import com.itheima.domain.User;
import com.itheima.mapper.UserMapper;
import com.itheima.utils.MapperUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class test {

    public static void main(String[] args) {
        List<User> list = null;
        //获取sqlSession对象
        SqlSession sqlSession = MapperUtils.getSqlSession();
        //获取映射对象
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        list = mapper.findAll();
        //释放资源
        sqlSession.close();
        System.out.println(list);
    }
}
